<div>
    <div class="main-page">    
        <div class="wrapper-content">            
            <img width="180px" height="180px" alt="<?php echo $model->alt ?>" src="<?php echo Yii::app()->createUrl('files/games/'.$model->image); ?>"/>
            <div class="game-info">
                <div style="margin-bottom: 3px;">
                    <a href="/">Trang chủ</a> » <?php echo $model->name ?>
                </div>
                <div class="game-info-item game-info-name"><?php echo $model->name ?></div> 
                <div class="game-info-item"><span>Nhà phát triển: </span><b>Casino888.vn</b></div>                
                <div class="game-info-item"><span>Số lượt tải: </span><?php  echo $model->countDownload;?></div>                
                <div class="group-download">
                    <ul>    
                        <?php if($model->getCurrentVersion('ios')): ?>
                        <li>
                            <div><a target="_blank" href="<?php if($model->getCurrentVersion('ios')) echo $model->getCurrentVersion('ios')->gamePlatform->market_url ?>" class="market-apple market" id="download_market"><img alt="" src="<?php echo Yii::app()->createUrl('css/images/apple_down.png') ?>">Appstore</a></div>
                            <div class="game-info" style="margin-top: 10px;">
                                <div class="game-info-item"><span>Version: </span><?php if(($model->getCurrentVersion('ios'))) echo $model->getCurrentVersion('ios')->getCurrentVersion(); else echo "N/A"; ?></div>
                                <div class="game-info-item"><span>Hỗ trợ: </span><?php if(($model->getCurrentVersion('ios'))) echo $model->getCurrentVersion('ios')->description; else echo "N/A"?></div>
                                <div class="game-info-item"><span>Dung lượng: </span><?php if(($model->getCurrentVersion('ios'))) echo $model->getCurrentVersion('ios')->getSize(); else echo "N/A"?></div>
                                <div class="game-info-item"><a href="<?php echo Yii::app()->createUrl('site/download?pcode=ios&game='.$model->code_identifier); ?>">Tải file .ipa</a></div>
                            </div>
                        </li> 
                        <?php endif;?>
                        <?php if($model->getCurrentVersion('android')): ?>
                        <li>
                            <nav><a target="_blank" href="<?php if($model->getCurrentVersion('android')) echo $model->getCurrentVersion('android')->gamePlatform->market_url ?>" class="market-google market" id="download_market"><img alt="" src="<?php echo Yii::app()->createUrl('css/images/android_down.png') ?>">Playstore</a></nav>
                            <div class="game-info" style="margin-top: 10px;">
                                <div class="game-info-item"><span>Version: </span><?php if(($model->getCurrentVersion('android'))) echo $model->getCurrentVersion('android')->getCurrentVersion(); else echo "N/A"; ?></div>
                                <div class="game-info-item"><span>Hỗ trợ: </span><?php if(($model->getCurrentVersion('android'))) echo $model->getCurrentVersion('android')->description; else echo "N/A"?></div>
                                <div class="game-info-item"><span>Dung lượng: </span><?php if(($model->getCurrentVersion('android'))) echo $model->getCurrentVersion('android')->getSize(); else echo "N/A"?></div>
                                <div class="game-info-item"><a href="<?php echo Yii::app()->createUrl('site/download?pcode=android&game='.$model->code_identifier); ?>">Tải file .apk</a></div>
                            </div>
                        </li>                            
                        <?php endif;?>
                        <?php if($model->getCurrentVersion('window')): ?>
                        <li>
                            <nav><a href="<?php echo Yii::app()->createUrl('site/download?pcode=window&game='.$model->code_identifier); ?>" class="not-market market" id="download_not_market"><img alt="" src="<?php echo Yii::app()->createUrl('css/images/btn_window.png') ?>">Tải về Window</a></nav>
                            <div class="game-info" style="margin-top: 10px;">
                                <div class="game-info-item"><span>Version: </span><?php if(($model->getCurrentVersion('window'))) echo $model->getCurrentVersion('window')->getCurrentVersion(); else echo "N/A"; ?></div>
                                <div class="game-info-item"><span>Hỗ trợ: </span><?php if(($model->getCurrentVersion('window'))) echo $model->getCurrentVersion('window')->description; else echo "N/A"?></div>
                                <div class="game-info-item"><span>Dung lượng: </span><?php if(($model->getCurrentVersion('window'))) echo $model->getCurrentVersion('window')->getSize(); else echo "N/A"?></div>                                
                            </div>
                        </li>
                        <?php endif;?>
                        <?php if($model->getCurrentVersion('j2me')): ?>
                        <li>
                            <nav><a href="<?php echo Yii::app()->createUrl('site/download?pcode=j2me&game='.$model->code_identifier); ?>" class="not-market market" id="download_not_market"><img alt="" src="<?php echo Yii::app()->createUrl('css/images/btn_java.png') ?>">Điện thoại Java</a></nav>
                            <div class="game-info" style="margin-top: 10px;">
                                <div class="game-info-item"><span>Version: </span><?php if(($model->getCurrentVersion('j2me'))) echo $model->getCurrentVersion('j2me')->getCurrentVersion(); else echo "N/A"; ?></div>
                                <div class="game-info-item"><span>Hỗ trợ: </span><?php if(($model->getCurrentVersion('j2me'))) echo $model->getCurrentVersion('j2me')->description; else echo "N/A"?></div>
                                <div class="game-info-item"><span>Dung lượng: </span><?php if(($model->getCurrentVersion('j2me'))) echo $model->getCurrentVersion('j2me')->getSize(); else echo "N/A"?></div>                                
                            </div>
                        </li>
                        <?php endif;?>
                    </ul>
                </div>
                <div class="social">
                    <div style="float:left!important;">
                        <div class="g-plusone" style="padding-top: 4px !important;" data-size="Medium" data-href="<?php echo Yii::app()->createAbsoluteUrl('game/'.$model->slug) ?>"></div>
                    </div>
                    <!-- Place this render call where appropriate -->
                    <script type="text/javascript">
                        (function() {
                           var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                           po.src = 'https://apis.google.com/js/plusone.js';
                           var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
                        })();
                    </script>
                    <div id="fb-root"></div>                
                    <script>(function(d, s, id) {
                      var js, fjs = d.getElementsByTagName(s)[0];
                      if (d.getElementById(id)) return;
                      js = d.createElement(s); js.id = id;
                      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=1401311996778175";
                      fjs.parentNode.insertBefore(js, fjs);
                    }(document, 'script', 'facebook-jssdk'));</script>
                    <div class="fb-like" style="margin: 0px 30px 0px 0px !important; width:50px !important; display: inline-block !important" data-href="<?php echo Yii::app()->createAbsoluteUrl('game/'.$model->slug) ?>" data-width="50" data-layout="button_count" data-show-faces="false" <div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="false" data-share="true" data-send="false"></div>
                </div>
            </div>             
        </div>    
    </div>
</div>

<div class="content-page">
    <div class="main-box">
        <div class="main-page">
            <div class="tab-panel-header">
                <ul class="tabBar col4" id="countrytabs">
                    <li class="tab"> <a rel="country1" class="selected"><span>TỔNG QUAN</span></a> </li>
                    <li class="tab"> <a rel="country2" class=""><span>BÌNH LUẬN</span></a> </li>                
                    <li class="tab"> <a rel="country3" class=""><span>BÁO LỖI</span></a> </li>                
                </ul>
            </div>    
            <div class="wrapper-content">
                <div id="country1" class="tabcontent" style="display: block">
                    <?php $content = str_replace('../../../../files/games/', '../files/games/', $model->description) ?>
                    <?php echo $content; ?>
                </div>
                <div id="country2" class="tabcontent" style="display:none">
                    <div class="fb-comments" data-href="<?php echo Yii::app()->createAbsoluteUrl('game/'.$model->id) ?>" data-numposts="10" data-colorscheme="light"></div>
                </div>                
                <div id="country3" class="tabcontent" style="display:none">
                    <div class="overview-reviews">
                                <div class="support">
                                    <h4>Thông tin phản hồi sẽ được gửi về email cho <a href="mailto:">Casino888.vn</a></h4>
                                    <div class="support_app">
                                        <p class="error" id="support-error" style="width:94%;display:none;">                                            
                                        </p>
                                        <p class="success" id="support-success" style="width:94%;display:none;">                                            
                                        </p>
                                        <label>Họ và tên:</label>
                                        <input id="support-name" class="support-input" type="text" value="">
                                        <label>Địa chỉ Email: <span class="red">(*)</span></label>
                                        <input id="support-email" class="support-input" type="text" value="">
                                        <label>Nội dung: <span class="red">(*)</span></label>
                                        <textarea name="textarea" id="textarea-support" class="areaSupport support-input"></textarea>
                                    </div>
                                    <div class="send_mess" style="display:inline-block">
                                                                                
                                    <input id="submit-support" type="submit" value="Gửi phản hồi" class="btSupport">                                        
                                    </div>
                                    
                                </div>
                            </div>
                </div>
            </div>    
        </div>    
    </div>
    <div class="left-box">
        <?php $this->widget('GamesWidget') ?> 
    </div>
</div>
<script type="text/javascript">    
$('.icon-mask').click(function(){
    
})    
    
$('#submit-support').click(function(){    
    var feedback = {
            name: $("#support-name").val(),
            email:$("#support-email").val(),
            content:$("#textarea-support").val()
        }
  $.ajax({
    url: '<?php echo Yii::app()->createUrl('site/feedback'); ?>',
    method: "POST",
    dataType: 'json',
    data:feedback,
    success: function(obj){        
        //obj = JSON.parse(response);
        if(obj.code == -1){
            $('#support-error').show();
            $('#support-success').hide();
            $('#support-error').html(obj.message);
        }else{
            $('#support-error').hide();
            $('#support-success').show();
            $('#support-success').html(obj.message);
            $('.support-input').val('');
        }
            
    }
});  
})

</script>

  



